<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>yukari world</title>
<#include "/lib/base_source.ftl">
<style type="text/css">
</style>
</head>
<body>
<#include "/lib/mask.ftl">
<div class='whole-container'>
<#include "/lib/header.ftl">
    <div>
        <ul class="breadcrumb">
        	<li>签到管理</li><span class="divider">/</span>
            <li>积分列表</li>
        </ul>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="container span12">
            <#include "/lib/alert.ftl">

                <div class='main-content'>

                    <div class="well form-inline">
                        <div class='main-action'>
                            <div>
                                <a class="btn btn-primary btn-sm" href="javascript:reloadAuth()">刷新缓存</a>
                            </div>
                        </div>
                    </div>

                    <div class="table-content">
                    <#-- table -->
                        <table class="table table-striped table-bordered table-condensed" id="itemTable" style="font-size:12px;word-break:break-all;word-wrap:break-word;">
                            <thead>
                            <tr >
                                <th style="width: 100px">排名</th>
                                <th style="width:300px;">名字</th>
                                <th style="width:300px;">分数</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#if list??>
                            <#list list as item>
                            	<tr id="${item.id?c}" >
                                	<td>${item_index+1}</td>
                                	<td>${item.name!}</td>
                                	<td>${item.score!}</td>
                                	<td>
                                        <a class="btn btn-sm btn-success" href="javascript:" onclick="aScore(${item.id?c})">加分</a>
                                        <a class="btn btn-sm btn-danger" href="javascript:" onclick="dScore(${item.id?c})">扣分</a>
                                	</td>
                                </tr>
                            </#list>
                            </#if>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>

    $(document).ready(function(){
    });

    function aScore(id){

    }

    function dScore(id){

    }

    function scoreAjax(id,socre){
        alert("尽情期待");
    }

    function reloadAuth(){
        $.ajax({
            url : "${rc.contextPath}/admin/auth/reloadAll",
            dataType : "json",
            type:'post',
            success:function(json){
                if (json.code == 0){
                    location.reload();
                } else {
                    alert("刷新失败");
                }
            }
        });
    }


</script>
</body>
</html>